#coding:utf-8
# add an item to a set
# remove an item from a set
thisset = {"apple", "banana", "cherry"}
thisset.add("orange")
print(thisset)
# add elements to a set
thisset = {"apple", "banana", "cherry"}
tropical = {"pineapple", "mango", "papaya"}
thisset.update(tropical)
print(thisset)
#The object in the update() method does not have to be a set,
#it can be any iterable object (tuples, lists, dictionaries etc.).
thisset = {"apple", "banana", "cherry"}
mylist = ["kiwi", "orange"]
thisset.update(mylist)
print(thisset)
thisset = {"apple", "banana", "cherry"}
thisset.remove("banana")
print(thisset)
#If the item to remove does not exist, discard() will NOT raise an error.
thisset.discard("cherry")
print(thisset)
thisset = {"apple", "banana", "cherry"}
print(thisset)
x = thisset.pop()
print(x)
print(thisset)
thisset.clear()
print(thisset)
"""
thisset = {"apple", "banana", "cherry"}
del thisset
print(thisset)
"""